package test
{
	import flash.display.Bitmap;
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.URLRequest;
	
	import level4.engines.GameEngine;
	import level4.display.players.bitmap_sequence.BitmapSequencePlayer;

	public class BitmapSequencePlayerTest extends Sprite
	{
		public function BitmapSequencePlayerTest()
		{
			var l:Loader = new Loader();
				l.load(new URLRequest("assets/C1_anim.png"));
				l.contentLoaderInfo.addEventListener(Event.COMPLETE,onOk);
		}
		private function onOk(e:Event):void{
			var bmp:Bitmap = e.target.loader.content;
			
			for(var i:int = 0;i<500;i++){
				var p:BitmapSequencePlayer = new BitmapSequencePlayer("player",bmp.bitmapData,30,3);
				addChild(p);
				p.x = Math.random() * 1024;
				p.y = Math.random() * 768;
				p.totalCount = 30 * 3;
				p.timeInterval = 50 * Math.random() + 50;
					//p.startPlay([0,0, 1,0, 2,0, 3,0,4,0]);
				p.startPlay();
			}
		}
	}
}